3.3.90 \(\int \frac {\tan (c+d x)}{a+b \sec (c+d x)} \, dx\) [290]

Optimal. Leaf size=35 \[ -\frac {\log (\cos (c+d x))}{a d}-\frac {\log (a+b \sec (c+d x))}{a d} \]

[Out]

-ln(cos(d*x+c))/a/d-ln(a+b*sec(d*x+c))/a/d

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 35, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.210, Rules used = {3970, 36, 29, 31} \begin {gather*} -\frac {\log (a+b \sec (c+d x))}{a d}-\frac {\log (\cos (c+d x))}{a d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Tan[c + d*x]/(a + b*Sec[c + d*x]),x]

[Out]

-(Log[Cos[c + d*x]]/(a*d)) - Log[a + b*Sec[c + d*x]]/(a*d)

Rule 29

Int[(x_)^(-1), x_Symbol] :> Simp[Log[x], x]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 36

Int[1/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Dist[b/(b*c - a*d), Int[1/(a + b*x), x], x] -
Dist[d/(b*c - a*d), Int[1/(c + d*x), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0]

Rule 3970

Int[cot[(c_.) + (d_.)*(x_)]^(m_.)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_), x_Symbol] :> Dist[-(-1)^((m - 1
)/2)/(d*b^(m - 1)), Subst[Int[(b^2 - x^2)^((m - 1)/2)*((a + x)^n/x), x], x, b*Csc[c + d*x]], x] /; FreeQ[{a, b
, c, d, n}, x] && IntegerQ[(m - 1)/2] && NeQ[a^2 - b^2, 0]

Rubi steps

\begin {align*} \int \frac {\tan (c+d x)}{a+b \sec (c+d x)} \, dx &=\frac {\text {Subst}\left (\int \frac {1}{x (a+x)} \, dx,x,b \sec (c+d x)\right )}{d}\\ &=\frac {\text {Subst}\left (\int \frac {1}{x} \, dx,x,b \sec (c+d x)\right )}{a d}-\frac {\text {Subst}\left (\int \frac {1}{a+x} \, dx,x,b \sec (c+d x)\right )}{a d}\\ &=-\frac {\log (\cos (c+d x))}{a d}-\frac {\log (a+b \sec (c+d x))}{a d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.04, size = 19, normalized size = 0.54 \begin {gather*} -\frac {\log (b+a \cos (c+d x))}{a d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Tan[c + d*x]/(a + b*Sec[c + d*x]),x]

[Out]

-(Log[b + a*Cos[c + d*x]]/(a*d))

________________________________________________________________________________________

Maple [A]
time = 0.04, size = 33, normalized size = 0.94

method result size
derivativedivides \(\frac {-\frac {\ln \left (a +b \sec \left (d x +c \right )\right )}{a}+\frac {\ln \left (\sec \left (d x +c \right )\right )}{a}}{d}\) \(33\)
default \(\frac {-\frac {\ln \left (a +b \sec \left (d x +c \right )\right )}{a}+\frac {\ln \left (\sec \left (d x +c \right )\right )}{a}}{d}\) \(33\)
risch \(\frac {i x}{a}+\frac {2 i c}{a d}-\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+\frac {2 b \,{\mathrm e}^{i \left (d x +c \right )}}{a}+1\right )}{a d}\) \(54\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(d*x+c)/(a+b*sec(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/d*(-1/a*ln(a+b*sec(d*x+c))+1/a*ln(sec(d*x+c)))

________________________________________________________________________________________

Maxima [A]
time = 0.27, size = 19, normalized size = 0.54 \begin {gather*} -\frac {\log \left (a \cos \left (d x + c\right ) + b\right )}{a d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)/(a+b*sec(d*x+c)),x, algorithm="maxima")

[Out]

-log(a*cos(d*x + c) + b)/(a*d)

________________________________________________________________________________________

Fricas [A]
time = 3.34, size = 19, normalized size = 0.54 \begin {gather*} -\frac {\log \left (a \cos \left (d x + c\right ) + b\right )}{a d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)/(a+b*sec(d*x+c)),x, algorithm="fricas")

[Out]

-log(a*cos(d*x + c) + b)/(a*d)

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 82 vs. \(2 (27) = 54\).
time = 3.39, size = 82, normalized size = 2.34 \begin {gather*} \begin {cases} \frac {\tilde {\infty } x \tan {\left (c \right )}}{\sec {\left (c \right )}} & \text {for}\: a = 0 \wedge b = 0 \wedge d = 0 \\\frac {x \tan {\left (c \right )}}{a + b \sec {\left (c \right )}} & \text {for}\: d = 0 \\\frac {\log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 a d} & \text {for}\: b = 0 \\- \frac {1}{b d \sec {\left (c + d x \right )}} & \text {for}\: a = 0 \\- \frac {\log {\left (\frac {a}{b} + \sec {\left (c + d x \right )} \right )}}{a d} + \frac {\log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 a d} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)/(a+b*sec(d*x+c)),x)

[Out]

Piecewise((zoo*x*tan(c)/sec(c), Eq(a, 0) & Eq(b, 0) & Eq(d, 0)), (x*tan(c)/(a + b*sec(c)), Eq(d, 0)), (log(tan
(c + d*x)**2 + 1)/(2*a*d), Eq(b, 0)), (-1/(b*d*sec(c + d*x)), Eq(a, 0)), (-log(a/b + sec(c + d*x))/(a*d) + log
(tan(c + d*x)**2 + 1)/(2*a*d), True))

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 114 vs. \(2 (35) = 70\).
time = 0.67, size = 114, normalized size = 3.26 \begin {gather*} \frac {\log \left (\frac {{\left | 2 \, b + \frac {2 \, a {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} - \frac {2 \, b {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} - 2 \, {\left | a \right |} \right |}}{{\left | 2 \, b + \frac {2 \, a {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} - \frac {2 \, b {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + 2 \, {\left | a \right |} \right |}}\right )}{d {\left | a \right |}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)/(a+b*sec(d*x+c)),x, algorithm="giac")

[Out]

log(abs(2*b + 2*a*(cos(d*x + c) - 1)/(cos(d*x + c) + 1) - 2*b*(cos(d*x + c) - 1)/(cos(d*x + c) + 1) - 2*abs(a)
)/abs(2*b + 2*a*(cos(d*x + c) - 1)/(cos(d*x + c) + 1) - 2*b*(cos(d*x + c) - 1)/(cos(d*x + c) + 1) + 2*abs(a)))
/(d*abs(a))

________________________________________________________________________________________

Mupad [B]
time = 1.47, size = 71, normalized size = 2.03 \begin {gather*} \frac {\mathrm {atan}\left (\frac {a\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{a\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,1{}\mathrm {i}+b\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,1{}\mathrm {i}+b\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,1{}\mathrm {i}}\right )\,2{}\mathrm {i}}{a\,d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(c + d*x)/(a + b/cos(c + d*x)),x)

[Out]

(atan((a*sin(c/2 + (d*x)/2)^2)/(a*cos(c/2 + (d*x)/2)^2*1i + b*cos(c/2 + (d*x)/2)^2*1i + b*sin(c/2 + (d*x)/2)^2
*1i))*2i)/(a*d)

________________________________________________________________________________________